package com.eric.code.toucheventdemo.view;

import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.LinearLayout;

import com.eric.code.toucheventdemo.utils.TouchUtils;

/**
 * Created by eric on 16-7-5.
 */
public class LinearLayoutView extends LinearLayout {
    private static final String TAG = "LinearLayoutView" ;
    public LinearLayoutView(Context context) {
        super(context);
    }

    public LinearLayoutView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public LinearLayoutView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.w(TAG,"dispatchTouchEvent -> "+ TouchUtils.getTouchAction(ev.getAction())) ;
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        Log.w(TAG,"onInterceptTouchEvent -> "+ TouchUtils.getTouchAction(ev.getAction())) ;
        return super.onInterceptTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.w(TAG,"onTouchEvent -> "+ TouchUtils.getTouchAction(event.getAction())) ;
        return super.onTouchEvent(event);
    }
}
